package com.jic.order.job;

import com.jic.common.base.vo.RestResult;
import com.jic.order.service.OrderAfterSaleTimeService;
import com.jic.order.service.OrderInfoSetService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单定时任务扫描
 */
@RestController
@RequestMapping("/job/scan/order")
public class JobScanController {

    @Autowired
    OrderInfoSetService orderInfoSetService;

    @Autowired
    OrderAfterSaleTimeService orderAfterSaleTimeService;


    @ApiOperation(value = "订单时效性扫描")
    @PostMapping("/orderExpiresJob")
    @ResponseBody
    public RestResult<String> orderExpiresJob() throws Throwable {
        return orderInfoSetService.regularOrdersTimely();
    }


    @ApiOperation(value = "订单售后有效期扫描")
    @PostMapping("/ ")
    @ResponseBody
    public RestResult<String> orderAfterSaleExpiresJob() throws Throwable {
        return orderAfterSaleTimeService.regularOrdersAfterSaleTimely();
    }

    @ApiOperation(value = "清结算")
    @PostMapping("/cleanSettlement")
    @ResponseBody
    public RestResult<String> cleanSettlementJob(){
        return null;
        //return orderInfoSetService.();
    }
}
